package uto.phone.flash.wind.app

import android.os.Bundle
import android.view.ViewGroup
import uto.phone.flash.wind.R
import uto.phone.flash.wind.base.IActivity
import uto.phone.flash.wind.base.IAdapter
import uto.phone.flash.wind.base.IHolder
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : IActivity() {

    private val adapter by lazy { object: IAdapter(activity = this){
        override fun createHolder(parent: ViewGroup, viewType: Int): IHolder {
            return when(viewType){
                0 -> HomeTopHolder(parent,activity,this)
                else -> HomeUserHolder(parent,activity,this)
            }
        }
        override fun getItemCount(): Int {
            return 2
        }
        override fun getItemViewType(position: Int): Int {
            return position
        }
    } }


    override fun layoutRes(): Int {
        return R.layout.activity_main
    }

    override fun initLayout(bundle: Bundle?) {
        rvContent.adapter = adapter
    }
}